<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="com.fantasy.entity.Page"%>
<%@ page import="com.fantasy.entity.Video"%>
<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <%
        Page<Video> videoPage = (Page<Video>)request.getAttribute("page");
        String name = (String) request.getAttribute("name");
    %>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>雷达哥洞察全局</title>
    <link rel="stylesheet" href="../bootstrap/css/style.css">
    <link rel="stylesheet" href="../bootstrap/css/font-awesome(1).css">
    <link rel="stylesheet" href="../bootstrap/css/nprogress.css">
    <link rel="stylesheet" href="../css/program.css">
    <link rel="stylesheet" href="../css/index.css">
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"
          integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">

</head>


<body>
<div class="wrapper">
    <!-- 左侧边栏       -->
    <jsp:include page="./leftSidebar.jsp"></jsp:include>
    <!-- 右侧边栏       -->
    <div class="aside">
        <!--  用来装作者相关评论关注等动态  -->
        <div class="widgets">
            <h4>搜索推荐</h4>
            <ul class="body random">
                <li>
                    <a href="javascript:;">
                        <p class="title">TV动画《满溢的水果挞将于2020年10月播出。</p>
                        <p class="reading">阅读(819)</p>
                        <div class="pic">
                            <img src="../uploads/right1.jpg" alt="">
                        </div>
                    </a>
                </li>
                <li>
                    <a href="javascript:;">
                        <p class="title">TV动画《EX-ARM》于2021年1月10日播出</p>
                        <p class="reading">阅读(906)</p>
                        <div class="pic">
                            <img src="../uploads/right2.jpg" alt="">
                        </div>
                    </a>
                </li>
                <li>
                    <a href="javascript:;">
                        <p class="title">手游《Fate/Grand》配信5周年纪念动画PV公开</p>
                        <p class="reading">阅读(509)</p>
                        <div class="pic">
                            <img src="../uploads/right3.jpg" alt="">
                        </div>
                    </a>
                </li>
                <li>
                    <a href="javascript:;">
                        <p class="title">芳文社漫画改编动画《满溢的水果塔》追加声优</p>
                        <p class="reading">阅读(679)</p>
                        <div class="pic">
                            <img src="../uploads/right4.jpg" alt="">
                        </div>
                    </a>
                </li>
                <li>
                    <a href="javascript:;">
                        <p class="title">TV动画《天使与龙的轮舞》将推出蓝光BOX。</p>
                        <p class="reading">阅读(889)</p>
                        <div class="pic">
                            <img src="../uploads/right5.jpg" alt="">
                        </div>
                    </a>
                </li>
            </ul>
        </div>

    </div>
    <!-- 中间部分       -->
    <div class="content">
        <div class="panel hots">
            <h3>搜索结果</h3>
            <%
                if(videoPage == null) {
                    response.sendRedirect("./search.do?action=page");
                } else {
                    for(int i = 0; i < videoPage.getItems().size(); i++){
                        Video video = videoPage.getItems().get(i);
                        if(i % 4 == 0){
            %>
            <ul>
                <li>
                    <a href="./video.jsp<%
                    out.print("?videoUrl="+video.getUrl()+"&videoImg="+video.getVideoImg()+"&videoId="+video.getId()+"&name="+video.getName()+"&describe="+video.getDescribe());
                    %>">
                        <img src="<%="/fantasy/videoUpload/" + video.getVideoImg()%>" alt="" style="cursor:pointer">
                        <span><%=video.getName()%></span>
                    </a>
                </li>
                <%
                }else if(i % 4 == 3){
                %>
                <li>
                    <a href="./video.jsp<%
                    out.print("?videoUrl="+video.getUrl()+"&videoImg="+video.getVideoImg()+"&videoId="+video.getId()+"&name="+video.getName()+"&describe="+video.getDescribe());
                    %>">
                        <img src="<%="/fantasy/videoUpload/" + video.getVideoImg()%>" alt="" style="cursor:pointer">
                        <span><%=video.getName()%></span>
                    </a>
                </li>
            </ul>
            <br>
                    <%
                        }else{
                    %>
                <li>
                    <a href="./video.jsp<%
                    out.print("?videoUrl="+video.getUrl()+"&videoImg="+video.getVideoImg()+"&videoId="+video.getId()+"&name="+video.getName()+"&describe="+video.getDescribe());
                    %>">
                        <img src="<%="/fantasy/videoUpload/" + video.getVideoImg()%>" alt="" style="cursor:pointer">
                        <span><%=video.getName()%></span>
                    </a>
                </li>
            <%
                        }
                    }
                }
            %>
        </div>
        <nav aria-label="Page navigation" style="margin-left: 400px">
            <ul class="pagination" style="width: 600px">
                <li>
                    <a href="./search.do?action=page&name=<%=name%>&pageNo=<%=videoPage.getPageNo() - 1%>&pageSize=<%=videoPage.getPageSize()%>" aria-label="Previous">
                        <span aria-hidden="true">上一页</span>
                    </a>
                </li>
                <li><a href="#"><%=videoPage.getPageNo()%><span class="sr-only">(current)</span></a></li>
                <li>
                    <a href="./search.do?action=page&name=<%=name%>&pageNo=<%=videoPage.getPageNo() + 1%>&pageSize=<%=videoPage.getPageSize()%>" aria-label="Next">
                        <span aria-hidden="true">下一页</span>
                    </a>
                </li>
                <li style="float:left;margin-left: 50px;margin-top: 7px">共<%=videoPage.getPageTotal()%>页</li>
            </ul>
        </nav>
    </div>
</div>
<script src="../bootstrap/js/jquery/jquery.min.js"></script>
<script type="text/javascript">

</script>
</body>